Method and system for improving disk drive performance

ABSTRACT

A method of writing data to a storage device that uses a first data block size, from a host system that uses a second data block size, different from the first data block size, includes receiving a request from the host system to write a host data block to the storage device, reading a storage device data block from a first location on the storage device to a buffer, where the storage device data block corresponds to the host data block, modifying the storage device data block based on the host data block, restricting writing of the modified storage device data block into the first location, and storing the modified storage device data block to a second location, different from the restricted first location. After acknowledging success of the storing, the restricting of writing of the modified storage device data block into the first location may be lifted.

CROSS REFERENCE TO RELATED APPLICATION

This claims the benefit of copending, commonly-assigned U.S. ProvisionalPatent Application No. 61/143,008, filed Jan. 7, 2009, which isincorporated by reference herein in its entirety.

FIELD OF INVENTION

This invention relates to a method and system for writing data to astorage device, and particularly to a method and system for maintainingdata integrity when writing data to a storage device.

BACKGROUND

Certain memory devices store data in blocks of a certain size. Whenstoring data to such a device, an entire block is typically written atonce. Similarly, when reading data from such a device, an entire blockis typically read at once. When a host device sends data to be written,or requests data to be read, in blocks of the same size, the systemoperates optimally. However, when the device operates on blocks of afirst size, and the host operates on blocks of a second size,inefficiencies arise.

For example, in a magnetic disk drive, data may be stored in “sectors,”where each sector is an angular portion of an annular “track.” Datatypically cannot be read or written from such a disk drive except inentire sectors. If the host wants to read data within a sector, the hostsends a request to the drive controller, and the entire sector is readand reported back to the host. Similarly, if the host wants to modifydata within a sector, the host sends to the drive controller a newversion of the entire sector, to be written over the current sectorcontents. Each such read or write operation requires only one driveaccess—either to read the sector or to replace the sector, which usuallyrequires only one physical pass over the sector, meaning only one diskrevolution is required.

A common sector size has been 512 B, which means the sector includes 512bytes of user data, plus overhead such as ECC and/or CRC information,sync marks, etc. More recently, disk drives with a sector size of 4 kBhave been introduced. Each sector in one of these newer drives includeseight times as much user data (i.e., 4,096 bytes) with essentially thesame amount of overhead. Therefore, the total overhead, for a disk of agiven total size using 4 kB sectors, is about one-eighth of the overheadfor a disk of the same total size using 512 B sectors.

However, many software applications, and even operating systems,continue to expect disk drive sectors of 512 B. This is typicallyhandled by having the disk drive controller emulate 512 B operation.Thus, the host may request to read a certain 512 B sector. Such a sectordoes not actually exist, but is mapped to a portion of 4 kB sector. Tofulfill the request, the drive controller reads the entire 4 kB sectorinto a buffer and returns to the host only the 512 B portion that thehost requested. A read operation therefore results in virtually no lossof efficiency, as a single read operation is performed regardless of thesector size.

On the other hand, if the host wants to write a particular 512 B sector,the host sends that sector to the drive controller as in the past.However, as stated above, data can be written only in full sectors. Inorder to write the 512 B sector that the host wants to write, the drivecontroller must write the entire 4 kB physical sector of which the 512 Bblock is a portion. Even if somehow only the 512 B portion could bewritten, ECC, CRC, checksum, parity and/or other overhead data for theentire 4 kB sector would change, necessitating writing the entiresector. However, the host has not sent the full 4 kB sector to allowoverwriting in a single operation as described above. Instead, the drivecontroller must read the 4 kB sector in question from the disk mediuminto a buffer, modify, in the buffer, the portion corresponding to the512 B block which the host wants to write plus the modified overheaddata, and then write the modified 4 kB sector back to the disk medium.This requires at least one (and generally only one) pass of the disk toread the 4 kB sector, and at least one (and generally only one) pass ofthe disk to write the 4 kB sector. Thus, about twice as many passes ofthe disk are required in emulation of write operations as compared todrives with native 512 B sectors.

In addition, if there is a failure of any kind at the disk during thewrite process, while that failure may be communicated to the host, thehost will associate the failure only with the 512 B block that itaddressed, not with other blocks in the physical disk drive sector inwhich the addressed block resided.

SUMMARY

A method of writing data from a host system to a storage device, wherethe storage device uses a first data block size and the host system usesa second data block size different from the first data block size,includes receiving a request from the host system to write a host datablock to the storage device, reading a storage device data block from afirst location on the storage device to a buffer, where the storagedevice data block corresponds to the host data block, modifying thestorage device data block based on the host data block, restrictingwriting of the modified storage device data block into the firstlocation, and storing the modified storage device data block to a secondlocation, different from the restricted first location.

The method may further include acknowledging success of the storing, andafter the acknowledging, lifting the restricting of writing of themodified storage device data block into the first location, and storingthe modified storage device data block to the first location.

According to an embodiment of the method, the storing of the modifiedstorage device data block to the first location occurs when the storagedevice is idle.

A data storage device capable of writing data received from a hostsystem, where the data storage device using a first data block size andthe host system using a second data block size different from the firstdata block size, includes controller circuitry that receives a requestfrom the host system to write a host data block to the storage device,and a buffer into which the controller circuitry reads a storage devicedata block corresponding to the host data block from a first location onthe storage device. The controller circuitry modifies the storage devicedata block based on the host data block, restricts writing of themodified storage device data block into the first location, and storesthe modified storage device data block to a second location, differentfrom the restricted first location.

In the data storage device, the controller circuitry may acknowledgesuccess of the storing, and after the acknowledging, the controllercircuitry may lift the restricting of writing of the modified storagedevice data block into the first location and store the modified storagedevice data block to the first location.

In an embodiment of the data storage device, wherein the controllercircuitry stores the modified storage device data block to the firstlocation when the storage device is idle.

BRIEF DESCRIPTION OF THE DRAWINGS

Further features of the invention, its nature and various advantages,will be apparent upon consideration of the following detaileddescription, taken in conjunction with the accompanying drawings, inwhich like reference characters refer to like parts throughout, and inwhich:

FIG. 1 is a schematic representation of an exemplary computer systemincluding a hard disk drive unit incorporating an embodiment of thepresent invention;

FIG. 2 shows a logical mapping of smaller disk sectors onto a largerdisk sector;

FIG. 3 shows a write operation in a previously known system;

FIG. 4 shows a write operation in a system according to an embodiment ofthe present invention; and

FIG. 5 shows operation of an embodiment of the present. invention on asystem such as that of FIG. 1.

DETAILED DESCRIPTION

As described in copending, commonly-assigned U.S. patent applicationSer. No. 12/407,426, filed Mar. 19, 2009 and hereby incorporated byreference in its entirety, once a buffered sector of a larger secondsize (e.g., 4 kB in the example above) has been rewritten in the bufferto replace the smaller “sector” (e.g., the 512 B portion in the exampleabove) within the buffered larger sector, the rewritten larger sectormay be stored in a temporary memory until the rewritten larger sectorcan be written to the drive medium at a time when the write operationwill not impact drive performance. For example, the rewritten sector maybe stored until the drive is idle. Alternatively, if enough temporarymemory is available, the rewritten sector may be kept in temporarymemory until the system is being shut down, and may then be written tothe drive. As a further alternative, if the temporary memory isnonvolatile, the rewritten sector may be kept in temporary memory evenafter a system shutdown—e.g., until the temporary memory is full oralmost full.

Because the system may attempt to access the rewritten sector before therewritten sector has been written to the drive, the drive's file systemtable or tables should be rewritten to identify the location of therewritten sector in the temporary memory, and then rewritten again whenthe rewritten sector has been written back to the drive medium. The filesystem table or tables may include one or more tables of the typerelated to file systems, such as a file allocation table, a defectmapping table, an LBA (logic block address) to PBA (physical blockaddress) mapping table, etc. Where the discussion and claims thatfollow, and the accompanying drawings, refer to a “file table” or “filesystem table” in the singular, any such reference should be understoodto include both the singular and the plural, in that the “table”referred to may include one or more of the foregoing types of filesystem tables.

The temporary memory may be provided on the drive controller chip, as aseparate chip within the drive unit, as a separate chip within the hostsystem, or as an external device. Other arrangements are also possible.

The temporary memory may be provided as a form of nonvolatile memorysuch as Flash memory. However, volatile memory such as SRAM or DRAM mayalso be used. If volatile memory is used, then if a shutdown or powerfailure occurs while there is still any rewritten sector that has notbeen written to the drive medium, the drive could become corrupted.Therefore, care must be taken not to allow the system to be shut downwithout writing the rewritten sector to the drive. In addition, for thesame reasons, it is likely that the rewritten sector would be kept for ashorter time in the temporary memory if the temporary memory werevolatile than if the temporary memory were nonvolatile.

Drive failures may nevertheless occur while there is still a rewrittensector that has not been written to the drive medium, whether or not thesystem was awaiting idle time in accordance with the disclosure of theabove-incorporated patent application (i.e., even if the rewrittenbuffered sector were to be rewritten without waiting for idle time).Such a failure could occur either because of a power failure or abnormalshutdown, as above, or because of other causes, such as a latent defectin a hard disk platter surface that manifests itself, or a physicaldisturbance (resulting, e.g., from an impact such as might be caused bya user jostling or dropping either the disk drive or a device in whichthe disk drive is contained) that affects the interface between theplatter surface and the read/write head of the disk drive (sometimesreferred to as a “head crash”). Such a failure also could occur withother types of storage devices. For example, a write operation to asemiconductor memory device could fail because of a strongelectromagnetic pulse in the vicinity of the memory device.

When such a failure occurs, the storage device controller will send afailure notification to the host system which requested the storagedevice access. However, the host system will associate that failure onlywith the block that the host system sought to write. If the host blocksize is smaller for any reason than the physical storage device blocksize, then the host system will not associate the failure with hostblocks that were part of a physical sector that had not been written tothe drive medium at the time of the failure. Therefore, any datarecovery efforts undertaken by the host (using, e.g., a copy of the hostblock intentionally cached until a write-success signal is received)would not recover the other host blocks. Moreover, even if the storagedevice controller were to advise the host as part of the failure messagethat other host blocks were affected, it is unlikely that the host willstill have cached copies of those other blocks available for recoveryefforts.

Therefore, in accordance with this invention, when the storage devicecontroller writes the rewritten larger sector data back to the drivemedium, the storage device controller is restricted from writing therewritten sector back to same physical location in which the rewrittensector was previously stored, meaning that the rewritten sector must bewritten to a new location. In addition, the original sector location isnot released in the system file tables to be overwritten by other datauntil the rewriting of the modified sector to its new location issuccessful. That way, in case of a write failure, the original sectordata will be preserved so that when the host, reacting to a failuresignal, initiates recovery efforts, the drive controller will haveaccess to the data for the other blocks in the physical sector that thehost is not aware were affected. Optionally, once the rewrite issuccessful, the drive controller, when it has time, can move therewritten sector from its new location to the original location, ratherthan freeing the original location. This option may be used, forexample, when it is important to maintaining physical contiguity of datain a file (i.e., to prevent file fragmentation).

As seen in FIG. 1, an exemplary computer system 100 may include a hostcomputer or processor unit 101 and a drive unit 102 which in oneembodiment may, for example, be a hard disk drive unit. A hard diskdrive (HDD) unit 102 may include a hard disk controller (HDC) 112 anddrive medium 105 (which may include one or more substantially circularplatters). Hard disk controller (HDC) 112 may have controller circuitry103 (e.g., on one or more integrated circuit chips) and temporary memory104 in accordance with the present invention (which, although shown asbeing separate from controller circuitry 103, may be included withincontroller circuitry 103).

Drive medium 105 may be divided into a plurality of concentric annulartracks 115, which may be further divided into a succession of angularportions called sectors 125. As discussed above, it had been common indisk drives for a sector to have a size of 512 B, but it is becomingmore common in disk drives for a sector to have a size of 4 kB.Therefore, as discussed above, controller circuitry 103 may translatebetween a first, larger physical sector size (e.g., 4 kB) used forsignaling A within drive unit 102, and a second, smaller logical sectorsize (e.g., 512 B) used for signaling B between drive unit 102 and hostsystem 101 which may have been designed to operate with drive unitsusing the smaller sector size.

The translation performed by controller circuitry 103 may be based onthe mapping shown in FIG. 2 wherein each larger physical sector 201 maybe divided logically into a plurality (e.g., eight, in the 512 B/4 kBexample) of smaller logical sectors 202.

As discussed above, in such a system, fulfillment by drive unit 102 ofread requests made by host system 101 generally does not suffer from athroughput penalty by virtue of the sector size translation. Althoughdrive unit 102 can only read or write entire sectors, rather thanportions of sectors, and therefore must read an entire sector 201 tofulfill a request to read a “sector” 202, such a read operation can bedone in about the same time as reading only sector 202 (were it possibleto do so). In the case of a disk drive, either read operation could beperformed in a single pass of the read-write head, and therefore thereis no latency for, e.g., additional drive revolutions. Indeed, it iscommon when reading a disk drive to read more than the requested data,so there is essentially no throughput penalty as a practical matter.

However, fulfillment of a write request may result in a throughputpenalty. Because drive unit 102 can only write an entire physical sector201, but host system 101 only provides a logical sector 202 to bewritten, it is not possible to simply overwrite an old sector with a newone in a single pass of read-write head. Rather, the physical sector 201of which the target logical sector 212 is a part must be read into abuffer 106, modified in buffer 106 to substitute the new data of logicalsector 212 for the contents of that logical sector, and then rewrittento the drive medium 105. At best, assuming that entire physical sector201 can be read and written in respective single passes, and that themodifications in the buffer 106 can be accomplished in the time neededfor a full revolution of medium 105, then the entire process can beperformed in two passes of the read-write head. Although buffer 106 isshown separately, buffer 106 may be part of temporary memory 104.

It should be noted that only about 10% of write operations would beexpected to involve only a partial physical sector 201 as in the examplejust given. About 90% of write operations could be expected to involvethe writing of entire physical sectors, rather than the modifying of apartial physical sector, which would involve extensive writing of entirephysical sectors 201. Nevertheless, if possible, it would be desirableto avoid any throughput penalty even for those 10% of operations.

It should further be noted that although the example just discussedinvolves traditional disk drives in which rotation time is a factor inmultiple accesses, latency resulting from multiple accesses even withoutfactoring in rotation time may still be of concern. Therefore thepresent invention may have applicability to other types of storage mediain which data is stored in units of a predetermined size such as disksectors. Similarly, although the invention is described in terms of“sectors” of different sizes, the invention applies to any type of datablocks of different sizes, regardless of what they may be called in aparticular type of storage medium. For example, NAND flash memory uses abasic storage unit called a “page,” which may be considered similar to adisk sector for purposes of the current disclosure.

When data is to be written to a smaller logical sector 202 within alarger physical sector 201, the physical sector 201 is read and bufferedas described above. The buffered data is modified according to the writerequest, but instead of being written immediately back to drive medium105, the rewritten sector 201 may be kept in temporary memory 104 untila later time at which writing to drive medium 105 would not affect datathroughput. For example, the rewritten sector 201 may be kept intemporary memory 104 until drive unit 102 is otherwise idle. The bufferin which the data is rewritten may be part of temporary memory 104 (seeFIG. 3) or even the same part of temporary memory 104 in which the datais kept after being rewritten, or may be separate memory in drivecontroller circuitry 103 or elsewhere (see FIG. 1).

Most disk drives in, e.g., personal computers are idle about 70% of thetime on average, so it would not be necessary to maintain rewrittensector 201 in temporary memory 104 for long under normal circumstances.Nevertheless, whatever the duration during which rewritten sector 201 iskept in temporary memory 104, host system 101 may make another requestto access the data in that sector. Therefore, the location of data inthat sector must be available to controller circuitry 103, and so thedrive's file system table may be updated to reflect that the sector inquestion is in temporary memory 104.

Once the rewritten sector has been stored in temporary memory 104 andnoted in the file system table, it is not necessary to write the sectorback to drive medium 105 as soon as drive 102 is idle. Although in oneembodiment of the invention, the sector is written back to drive medium105 as soon as possible, in other embodiments of the invention, thesector may be kept in temporary memory 104 for a time durationdetermined by factors such as the amount of available temporary memory104 and the nature of temporary memory 104.

For example, if drive medium 105 is a conventional disk drive andtemporary memory 104 is some form of solid-state random-access memorysuch a Flash memory, SRAM or DRAM, access may actually be faster whilethe data is in temporary memory 104 than when the data is on drivemedium 105. Therefore, it may be desirable to keep the data in temporarymemory 104 until the space in temporary memory 104 is needed forrewriting another sector 201 from drive medium 105. This would be afunction of how much temporary memory 104 is provided in system 100.

Thus, in one alternative embodiment, data may be kept in temporarymemory 104 until temporary memory 104 reaches some threshold fraction ofits capacity, after which the data is written back to drive medium 105to make room in temporary memory 104, so as not to compromise throughputby preventing the rewriting of additional sectors 201 because of theunavailability of temporary memory 104. Although in case ofunavailability of temporary memory 104, system 100 operates no slowerthan previously known systems in which the rewritten data must beimmediately rewritten to drive medium 105, such a situation can beavoided in this alternative embodiment by providing the proper amount oftemporary memory 104. This can be determined by statistical analysis,for example, based on the expected use to which system 100 will be put,and may be further informed by simulations.

Another factor that affects how soon the rewritten sector 201 is writtenback to drive medium 105 is the type of memory used for temporary memory104. For example, if temporary memory 104 is any form of nonvolatilememory such as Flash Memory or other NVRAM, then there is little chanceof data loss (which in this case could result in drive corruption) bykeeping data in temporary memory 104 until temporary memory 104 is full,or at some predetermined fraction of its capacity, even throughpower-down/power-up cycles of system 100.

If, on the other hand, temporary memory 104 is SRAM, DRAM or any otherform of volatile memory, then data cannot be kept in temporary memory104 through a power-down cycle of system 100, which would result in lossof the data and consequently possible drive corruption. Moreover, incase of an abnormal shut-down or power failure, the same result couldoccur. Therefore, in such an alternative embodiment, one would attemptto minimize as much as possible how long the data is kept in temporarymemory 104. In such case, data might be written back to drive medium 105at the first available idle time. However, even where volatile memory isused, the data may be kept for a longer period in temporary memory 104,but never past a power-down cycle of system 100. Part of the power-downsequence of such an embodiment may include a step of any writing datastill in temporary memory 104 back to drive medium 105.

Temporary memory 104 also can be a mix of SRAM, DRAM or any other formof volatile memory, with some form of nonvolatile memory such as flashmemory. For example, SRAM may be used in a drive as a temporary bufferfor sectors that are modified, and any such sectors may be written backto disk when the drive is idling. However, in the event of sudden powerloss, the controller may instruct the SRAM to transfer the bufferedsectors to flash memory instead of the disk medium, because writing toflash memory may draw less power than writing to the disk medium,thereby consuming less of the available residual power. In such a case,the temporary memory 104 includes a mixture of SRAM and flash. Becausemost modern hard disk drives already have both SRAM and flash memory,such an arrangement is possible without substantial hardwarealterations.

The foregoing example also shows that the choice of when and where towrite the modified sectors can depend on a number of factors, such asthe transaction type (e.g., whether it is mission critical or not) andthe system condition (e.g., normal condition, power loss, etc.).

Whenever rewritten sector 201 finally is written back to drive medium105—whether immediately, when the system is idle, or at some latertime—in accordance with an embodiment of the present invention,controller 112 is restricted from writing sector 201 back to itsoriginal physical location. Instead, sector 201 is written to a newlocation. If the write operation is successful, then controller 112sends a write success signal to host 101 and also notes the new locationin the file system tables. If the write operation fails, then controller112 sends a write failure signal to host 101, and keeps the old locationin the file system tables. That way, the smaller blocks that host 101did not intend to change are preserved, and controller 112 can take theminto account in any recovery efforts undertaken by host 101 with regardto the smaller block that was intended to be changed.

After the write operation is ultimately successful, whether on the firstor a subsequent attempt, controller 112 can move the sector 201 databack to its original location, or keep the sector 201 data where it isin its new location. Whether the data is moved back to the originallocation or not depends on the importance assigned to preventing filefragmentation. If rewriting occurs, the rewriting may be performedduring drive or system idle time.

FIG. 3 shows how a write operation might proceed in a previously knownsystem. Host 101 instructs that smaller block 301 (depicted as 512 B) berewritten. Smaller block 301 is actually a portion of a larger physicalsector 302 including a plurality of other blocks 303. Although eachsector 302 is shown as including four blocks 301/303, that is for easeof illustration only. In the embodiments discussed above, sector 302would include eight blocks 301/303, but there could be any number ofblocks 301/303 depending on the particular implementation.

As seen in FIG. 3, after issuing Write command 304, host 101 waits at305 for a success/failure notification 306 from drive controller 112. Inthe meantime, controller 112 reads at 307 the original sector 302,modifies the original sector 302 at 308 by inserting the altered block301 and changing the overhead information accordingly, and then writesthe modified sector data at 309 to drive medium 105. Depending on theresult of writing 309, controller 112 will send to host 101 a signal 306indicating success or failure.

If signal 306 is “success” (not shown), then things proceed withoutconsequence. However, if, as shown, signal 306 is “fail(ure),” host 101will be made aware that its attempt to rewrite block 301 has failed.Host 101 may then initiate recovery actions. For example, block 301 mayhave been retained in working memory, or in a cache (neither shown), andif there is a failure indication, Write command 304 may be reissued.Reissuing Write command 304 would not be sufficient, however, becausethe remaining blocks 303 in sector 302 would have been destroyed. Buthost 101 is not aware of the need to recover the remainder of sector302, nor does is host 101 necessarily have the resources (such as cachedcopies) to do so even if host 101 were aware of the need to recover theremainder of sector 302.

According to embodiments of the invention, a write operation may proceedas shown in FIG. 4 instead of as shown in FIG. 3. As seen in FIG. 4,after issuing Write command 404, host 101 waits at 405 for asuccess/failure notification 406 from drive controller 112. In themeantime, at 407, controller 112 reads the original sector 302, modifiesit at 408 by inserting the altered block 301, and then writes it at 409to a different location on drive medium 105, having been restricted fromoverwriting the original location on drive medium 105. Depending on theresult of writing at 409, controller 112 will send to host 101 a signal406 indicating success or failure.

If signal 406 is “success”, then things proceed without consequence,with modified sector 302 initially remaining in its new location.Ultimately, controller 112 may move modified sector 302 back to itsoriginal location, or not, as discussed above, ultimately freeing one ofthe two locations for storing other data. However, if signal 406 is“fail(ure),” host 101 will be made aware that its attempt to rewriteblock 301 has failed. Host 101 may then initiate recovery actions. Forexample, block 301 may have been retained in working memory, or in acache (neither shown), and if there is a failure indication, Writecommand 404 may be reissued. Although host 101 is unaware of the need todeal with recovery of the remaining blocks 303 in sector 302, controller112 is aware that block 301 is part of sector 302, and will read theoriginal sector 302 in repeated operation 407. Controller 112 would notfree the original location of sector 302 until it knew that someiteration of Write operation 404 had been successful.

The flow of an exemplary embodiment of a method according to the presentinvention is shown in FIG. 5.

According to that method, in Operation 1, “disk sector #0” (i.e., thatone of physical sectors 201 identified as #0) is read into a buffer 106(not shown separately in FIG. 5) by hard drive controller (HDC) 103.Next, at Operation 2, “host sector #3” (i.e., the fourth one 212 ofeight smaller logical “sectors” 202 within physical sector 201) ismodified within the buffer according to a new “host sector #3” sent byhost system 101. As part of that step, the entire “disk sector” orphysical sector 201 is re-encoded if needed.

Then, in Operation 3, the rewritten “disk sector #0” is stored to Flashmemory 104, which preferably is somewhere within drive unit 102 asdiscussed above. The step does not require spinning the disk, andaccordingly represents a savings of time over previously known methods.In Operation 4, the file system table is updated to indicate that disksector #0 is now in Flash memory 104.

The system then waits until disk medium 105 is free of other tasks (oruntil some later time as discussed above) and, in Operation 5, writesthe new disk sector #0 back to disk medium 105. Finally, in Operation 6,after acknowledgment of a successful Write operation, the file systemtable is updated again to reflect that disk sector #0 is once again ondisk medium 105. Operations 5 and 6 may be performed during idle time,while only Operations 1-4 need be performed in real time.

As shown in FIG. 5, the original physical location 501 of disk sector #0on disk medium 105 before modification is different from its location502 after modification, because of the restriction against writing tooriginal location 501. However, the sector in location 502 ultimatelycould be written back to location 501. Similarly, file system table 503is shown located on disk medium 105. However, file system table 503 alsocould be located elsewhere according to the design of drive unit 102.

The present invention thus improves the throughput of a drive unit in asystem in which the drive unit uses a drive sector of a first size, andthe system host uses a drive sector of a second size, by allowingwriting of the rewritten sector back to the drive medium to be delayeduntil the drive is less busy. While the invention has been described inthe context of the first size being larger than the second size, it mayalso apply where the second size is larger than the first size. Also,one or more steps of the method described above may be performed in adifferent order (or concurrently) and achieve desirable results.Finally, although drive medium 105 has been described as a disk drivemedium, it could be any form of nonvolatile memory that is used as astorage “drive,” such as a solid state drive, and including, but notlimited to, any of the nonvolatile storage technologies described abovein connection with temporary memory 104.

It will be understood that the foregoing is only illustrative of theprinciples of the invention, and that the invention can be practiced byother than the described embodiments, which are presented for purposesof illustration and not of limitation, and the present invention islimited only by the claims which follow.

What is claimed is:
 1. A method of writing data from a host system to astorage device, said storage device using a first data block size andsaid host system using a second data block size different from saidfirst data block size, said method comprising: receiving a request fromsaid host system to write a host data block to said storage device;reading a storage device data block from a first location on saidstorage device to a buffer, said storage device data block correspondingto said host data block; modifying said storage device data block basedon said host data block; restricting writing of data into said firstlocation; storing said modified storage device data block to a secondlocation, different from said restricted first location; acknowledgingsuccess of said storing; and after said acknowledging, lifting saidrestricting of writing data into said first location, and storing saidmodified storage device data block to said first location.
 2. The methodof claim 1 wherein: said restricting writing of data into said firstlocation comprises preventing all writing of data into said firstlocation by preventing release of said first location in a system filetable.
 3. The method of claim 2 wherein said lifting said restricting ofwriting of data into said first location comprises allowing release ofsaid first location in said system file table.
 4. The method of claim 1,wherein said storing said modified storage device data block back tosaid first location occurs when said storage device is idle.
 5. Themethod of claim 1, wherein said storing to said second locationcomprises writing to a nonvolatile location.
 6. The method of claim 5,wherein said writing to said nonvolatile location comprises writing toone of a different location on said storage device or a nonvolatilememory.
 7. The method of claim 1 wherein said restricting writing ofdata into said first location comprises preventing all writing of datainto said first location.
 8. The method of claim 7 wherein saidpreventing all writing of data into said first location comprisespreventing release of said first location in a system file table.
 9. Themethod of claim 1 further comprising: reporting failure of said storing;and after said reporting: receiving from said host system a reissuedrequest to write said host data block, and re-reading said storagedevice data block corresponding to said host data block from saidrestricted first location on said storage device.
 10. A data storagedevice capable of writing data received from a host system, said datastorage device using a first data block size and said host system usinga second data block size different from said first data block size, saiddata storage device comprising: controller circuitry that receives arequest from said host system to write a host data block to said storagedevice; and a buffer into which said controller circuitry reads astorage device data block corresponding to said host data block from afirst location on said storage device; wherein: said controllercircuitry modifies said storage device data block based on said hostdata block; said controller circuitry restricts writing of data intosaid first location; said controller circuitry stores said modifiedstorage device data block to a second location, different from saidrestricted first location; said controller circuitry acknowledgessuccess of said storing; and after said acknowledging, said controllercircuitry lifts said restricting of writing of data into said firstlocation, and stores said modified storage device data block to saidfirst location.
 11. The data storage device of claim 10 wherein: saidcontroller circuitry restricts said writing of data into said firstlocation by preventing all writing of data into said first location bypreventing release of said first location in a system file table. 12.The data storage device of claim 11 wherein said controller lifts saidrestricting of writing of data into said first location by allowingrelease of said first location in said system file table.
 13. The datastorage device of claim 10, wherein said controller circuitry storessaid modified storage device data block to said first location when saidstorage device is idle.
 14. The data storage device of claim 10, whereinsaid second location comprises a nonvolatile location.
 15. The datastorage device of claim 14, wherein said nonvolatile location comprisesone of a different location on said storage device or a nonvolatilememory.
 16. The data storage device of claim 10 wherein said controllerrestricts said writing of data into said first location by preventingall writing of data into said first location.
 17. The data storagedevice of claim 16 wherein said controller prevents all writing of datainto said first location by preventing release of said first location ina system file table.
 18. The data storage device of claim 10 wherein:said controller circuitry reports failure of said storing; and aftersaid reporting, said controller circuitry: receives from said hostsystem a reissued request to write said host data block, and re-readssaid storage device data block corresponding to said host data blockfrom said restricted first location on said storage device.